package com.xugongzhang.spring.config;

import com.xugongzhang.spring.beans.Dog;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author X
 * @date 2022/12/4 1:50
 */
// 使用该注解可以读取外部配置文件，保存到运行环境的变量中，让@Vaule注解使用
@PropertySource(value = {"classpath:/dog.properties"}, encoding = "UTF-8")
@Configuration
public class MainConfigOfPropertyValues {
    @Bean
    public Dog dog() {
        return new Dog();
    }
}
